{% extends "master.html" %}
{% block subtitle %} - 基础信息 - 商品属性管理 - 创建{{label}}{% endblock %}


{% block extJS %}
<script language="JavaScript" type="text/javascript">
//<![CDATA[
    function toSubmit(){
        var msg = []
        if(!$("#name").val()){
            msg.push('请填写商品属性的名称！')
        }
        
        if(msg.length > 0){
            alert(msg.join("\n"));
        }else{
            $("form").submit();
            
        }
        
        
    }
    
    function toCancel(){
        {% if t %}
            var url = "{{url_for('.view',action='masindex',t=t)}}";
        {% else %}
            var url = "{{url_for('.view',action='pdtattr')}}";
        {% endif %}
         redirect_alert("{{MSG_LEAVE_WITHOUT_SAVING}}",url);
    }
//]]>
 </script>
{% endblock %}

{% block main %}
<div class="container">
    <div class="row">
        <ol class="breadcrumb">
          <li><a href="{{url_for('bpMas.view')}}">基础信息</a></li>
          <li><a href="{{url_for('bpMas.view',action='pdtattr')}}">商品属性管理</a></li>
          <li><a href="{{url_for('bpMas.view',action='masindex',t=t)}}">{{label}}</a></li>
          <li class="active">创建{{label}}</li>
        </ol>
    </div>
    <div class="row">
        <div class="btn-toolbar pull-right">
            <div class="btn-group"><button type="button" class="btn btn-primary" onclick="toSubmit()">{{BTN_SUBMIT}}</button></div>
            <div class="btn-group"><button type="button" class="btn btn-inverse" onclick="toCancel()">{{BTN_CANCEL}}</button></div>
        </div>
    </div>
    <div class="row">
        <form class="form-horizontal" method='POST' action="{{url_for('bpMas.view',action='saveNew')}}"  enctype="multipart/form-data">
            <fieldset>
                <legend>{{label}}基本信息</legend>
            <input type="hidden" name="t" value="{{t}}"/>
            {{ mymacros.render_required_field(form.name) }}
            {{ mymacros.render_field(form.remark) }}
            </fieldset>     
        </form>
    </div>
    
   
</div>
{% endblock %}